Step by step: How to profile an IIS project

Due to its very nature, profiling an IIS dll is very tricky.

The technique described consists in using a profiling plan with the 'internal' method, and restarting the IIS server between sessions.


1. Run the profiler: menu Start / Programs / VB Watch 2 / VB Watch Profiler.
2. Click the Options... button in the toolbar and Open VB Watch Control Center...
3. In the control center, select the base profiling plan you wish to use (Full Profiling suggested), then click Save Plan and give it a new name such as Profile IIS.
4. Make sure that Data acquisition method under TRANSFORMATIONS is set to Auto-Select or Internal.
5. Note: you can leave Execute default action.. checked under APPLY TO / After process / After compile but please note that it will not work if you have set it to Start Component in your project option. In this case you'll have to open an asp page manually to exercize your dll.
6. Also, make sure, in the General Options tab below, that the Disable Retained in Memory box is checked.
7. You can do any other modification to this plan you wish, then save it and exit the Control center.
Next time you don't need create a new plan. Just pick this one again.
8. Back in the profiler, click the Profile Project... button on the left and browse for your project. It gets instrumented and compiled. If not, compile it manually.
Note: the compilation will fail whenever the previous dll is in use. If it happens, run iisreset as shown in step 10 and compile manually.
9. Now exercize your dll with the proper asp page. Once done, close the page.
10. You will not see anything yet in the profiler. This is because the IIS server has not released the dll from memory yet. We will force it by restarting IIS:
Click the Start menu in the bottom left corner of the screen, the Run then enter exactly: iisreset and OK.
11. Look at the profiler session pane: your session is ready !